package com.api.shopapi.service;

import com.api.shopapi.entity.Goods;
import com.api.shopapi.entity.dto.GoodsDTO;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author maochuan
 */

public interface GoodsService {

    int insert(Goods goods);

    int update(Goods goods);

    List<GoodsDTO> getByGovernmentCode(String governmentCode);

    PageInfo<GoodsDTO> getByGovernmentCodeForPage(int pageIndex, int pageSize, String governmentCode, String name);

    Goods getByName(String name,String governmentCode);

    GoodsDTO getByGoodsCode(String goodsCode);

    List<GoodsDTO> getByGoodsClassBusinessCode(String goodsCode);

    PageInfo<GoodsDTO> getByBusinessCode(int pageIndex, int pageSize,
                                         String businessCode, int status,
                                         String name, int isRecommend,
                                         int isDelete, int isBargainPrice,
                                         String goodsClassGovernmentCode);


    PageInfo<GoodsDTO> getByGovernmentCode1(int pageIndex, int pageSize, String governmentCode,
                                            String name,String goodsClassGovernmentCode);



    PageInfo<Goods> PageByGovernmentCodeBusinessCode(int pageIndex, int pageSize,
                                                        String governmentCode, String businessCode);

    PageInfo<Goods> PageByGovernmentCodeBusinessCodePad(int pageIndex, int pageSize,
                                                        String governmentCode, String businessCode);


    PageInfo<GoodsDTO> getPageByGovernmentCode(int pageIndex,
                                         int pageSize,
                                         String governmentCode,
                                         String name,
                                         int isRecommend,
                                         int isDelete,
                                         int isBargainPrice,
                                         String goodsClassGovernmentCode);



    PageInfo<GoodsDTO> getByGoodsClassGovernmentCode(int pageIndex, int pageSize, String goodsClassGovernmentCode,
                                       String governmentCode);

    PageInfo<GoodsDTO> getFirstGoodsClass(int pageIndex, int pageSize, String goodsClassCode, String governmentCode);

    PageInfo<GoodsDTO> getByGoodsName(int pageIndex, int pageSize, String name, String governmentCode);

    List<GoodsDTO> getListByBusinessCodeKey(String businessCode, String key);

    List<Goods> getGoods();




    /**
     * 商家的正常商品列表
     * */
    PageInfo<Goods> PageByBusinessCodeNormal(int pageIndex, int pageSize, String businessCode,
                                             String name,int status,String goodsClassGovernmentCode);


    /**
     * 商家删除的商品列表
     * */
    PageInfo<Goods> PageByBusinessCodeDelete(int pageIndex, int pageSize, String businessCode, String name);



    /**
     * 商家收银机的商品列表
     * */
    PageInfo<Goods> PageByBusinessCodePad(int pageIndex, int pageSize, String businessCode);



}
